package com.zxy.controller;

import com.zxy.model.Ordering;
import com.zxy.model.OrderingOk;
import com.zxy.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class StockController {
    @Autowired
    private StockService stockService;
    @GetMapping("/stock")
    public int ordering(@RequestParam Integer productId,@RequestParam Integer qty){
        return stockService.deduct(productId, qty);
    }
}
